package com.wlr.blog.web.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wlr.blog.web.common.entity.Category;
import com.wlr.blog.web.common.mapper.CategoryMapper;
import com.wlr.blog.web.common.service.CategoryService;
import com.wlr.blog.web.common.utils.PageResult;
import com.wlr.blog.web.common.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Autowired
    CategoryMapper categoryMapper;

    @Override
    public PageResult getPageList(Category category) {
        PageUtil.startPage();
        List<Category> categories = categoryMapper.selectList(new QueryWrapper<Category>(category));
        return new PageResult(categories);
    }
}
